<?php
$id = $_GET['id'];
$ids = array(
"zhpd" => "1",
"lysw" => "2",
"ggpd" => "11",
);
$ref = "http://m.3xgd.com/live/tv/channelid/".$ids[$id].".html";
$url = "http://m.3xgd.com/live/getliveurl20210322/channelid/".$ids[$id];
$header = array(
"User-Agent: Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.114 Mobile Safari/537.36",
"Referer: $ref"
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
//curl_setopt($ch, CURLOPT_PROXY, "192.168.2.188"); //代理服务器地址
//curl_setopt($ch, CURLOPT_PROXYPORT, 8888); //代理服务器端口
//curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); //使用http代理模式
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//若给定url自动跳转到新的url,有了下面参数可自动获取新url内容：302跳转
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$result = curl_exec($ch);
if (curl_errno($ch)) {
print_r(curl_getinfo($ch));
}
curl_close($ch);
$data = str_replace('";','',str_replace('liveaddr="','',$result));
//echo $data;
$playurl = openssl_decrypt($data, 'aes-128-cbc', "axsrtrirgbmg56m", 2, base64_decode("NVVRRACjfgheruVNCGoJUI=="));
//echo $playurl;
header('Location:'.trim($playurl));
?>